#!/usr/bin/python
# -*- coding: UTF-8 -*-

import pandas as pd
import utils


def read_excel(f):
	base = pd.read_excel(f)
	data = utils.clear_cli(base)
	return data


def convert(files):
	print("-- convert json")
	path = "./../output/json/"
	for file in files:
		name = utils.name(file) + ".json"
		data = read_excel(file)
		data.to_json(path + name, orient = 'index', force_ascii=False)
		print("json: " + path + name)


if __name__ == '__main__':
	print("测试输出")
	print("------------------------------------------------")
	convert(["./../excel/example.xlsx"])



